package cn.clq.ymcc.feign;

import cn.clq.ymcc.doc.CourseDoc;
import cn.clq.ymcc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author clqlongbao
 * @version 1.0
 * @description: TODO
 * @date 2022/7/25 14:56
 */
@FeignClient(value = "service-search",fallbackFactory = CourseSearchFeignClientFallBackFactory.class)
public interface CourseSearchFeignClient {
    /**
     * @description: 将课程保存到ES
     * @param: courseDoc
     * @return: cn.clq.ymcc.result.JSONResult
     * @author clqlongbao
     * @date: 2022/7/25 17:24
     */
    @PostMapping("/saveCourse")
    JSONResult saveCourse(@RequestBody CourseDoc courseDoc);

    /**
     * @description: 从ES中删除课程
     * @param: courseDoc
     * @return: cn.clq.ymcc.result.JSONResult
     * @author clqlongbao
     * @date: 2022/7/25 17:29
     */
    @PostMapping("/deleteCourse")
    JSONResult deleteCourse(@RequestBody CourseDoc courseDoc);
}
